Field of the Invention
The present invention relates to an image data encoding technique.
Description of the Related Art
JPEG-LS is an image data encoding method. JPEG-LS can select lossless coding and near-lossless coding. Also, JPEG-LS realizes a high compression ratio by switching predictive coding and runlength coding based on the states of surrounding pixels of an encoding target pixel. In predictive coding, the pixel value of an encoding target pixel is predicted from surrounding pixels, and a predictive error is encoded by Golomb-Rice coding. There is also a known method by which after Golomb-Rice coding is performed, whether the used encoding parameter is appropriate is evaluated, and an encoding parameter to be used next is determined (updated) (for example, Japanese Patent No. 4732203 to be referred to as literature 1 hereinafter).
A coding method which uses a coding method such as JPEG-LS as a coefficient of wavelet transform is also available. A method of determining an encoding parameter by using the correlation between subband components generated by wavelet transform and the correlation between surrounding wavelet coefficients is also known (for example, Japanese Patent No. 5218318 to be referred to as literature 2 hereinafter).
Assume that a coefficient value obtained by converting the frequency of image data is input, the coefficient value of an encoding target coefficient is predicted from surrounding coefficients, and a predictive error is encoded by entropy coding. When determining an encoding parameter of a predictive error as an encoding target, the method of literature 1 evaluates the encoding parameter by using only the code length of a most recently generated code. Therefore, the accuracy of update becomes insufficient if state separation is not properly performed. The method of literature 2 requires a one-line coefficient buffer for each subband component, and hence increases the memory cost.